#include <gui/motorpage_screen/MotorPageView.hpp>
#include <gui/motorpage_screen/MotorPagePresenter.hpp>

MotorPagePresenter::MotorPagePresenter(MotorPageView& v)
    : view(v)
{

}

void MotorPagePresenter::activate()
{
		MotorPagePresenterState(true);
}

void MotorPagePresenter::deactivate()
{
		MotorPagePresenterState(false);	
}
//风扇操作
void MotorPagePresenter::turnFanStatus(bool enable)
{
		model->turnFanStatus(enable);	//风扇状态的设置
}
//振动电机操作
void MotorPagePresenter::turnMotorStatus(bool enable)
{
		model->setMotorStatus(enable);	//振动电机状态的设置
}
//蜂鸣器操作
void MotorPagePresenter::turnBuzzerStatus(bool enable)
{
		model->setBuzzerStatus(enable);	//蜂鸣器状态的设置
}
//物理按键的页面跳转
void MotorPagePresenter::MotorPageChange(uint8_t newFiveKeyFunc)
{
		view.MotorPageChange(newFiveKeyFunc);	
}
//MotorPagePresenter状态
void MotorPagePresenter::MotorPagePresenterState(bool enable)
{
		if(enable == true)
			model->MotorPageViewTask(true);
		else
			model->MotorPageViewTask(false);
}